<?php

namespace Tests;


use XWX\Common\H;
use XWX\Common\Util\Xml;
use XWX\Common\XArray\XArray;
use XWX\Common\XReturn;

class test_str extends TestBase
{
    function test_1010()
    {
        $str = 'app_admin_xx';

        $str1 = H::funcStrToCamelize($str);
        $str2 = H::funcStrToUnCamelize($str1);

        $str3 = H::funcStrSplit($str, 4);

        $this->funcLog($str);
        $this->funcLog($str1);
        $this->funcLog($str2);
        $this->funcLog($str3);

        $this->assertTrue(true);
    }

    function test_1020()
    {
        $xml = '<xml>
<act_name>act_name</act_name>
<mch_billno>2334580734271081478888000026</mch_billno>
<mch_id>11475856</mch_id>
<nonce_str>1233213123123</nonce_str>
<notify_way>MINI_PROGRAM_JSAPI</notify_way>
<re_openid>oeDV3t7xy1IkfYFzgOsCZvdRjb45</re_openid>
<remark>remark</remark>
<send_name>思优米</send_name>
<total_amount>100</total_amount>
<total_num>1</total_num>
<wishing>你很棒</wishing>
<wxappid>wxd27ebc41b85ce36d</wxappid>
<sign>b9dca63fe3f06bba49b6c4d6d2035b72</sign>
</xml>';
        $arr = Xml::toArr($xml);
        $arr['test'] = [
            'aaa' => 'aaa',
            'bbb' => 'bbb',
        ];
        $xml_obj = Xml::arrToXml($arr);
        $this->funcLog($xml_obj->asXML());
        $this->funcLog(Xml::toArr($xml_obj->asXML()));
        $this->assertTrue(true);
    }
}
